﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"  %>
<%@ Register src="help.ascx" tagname="help" tagprefix="uc1" %>
<%@ Register src="head.ascx" tagname="head" tagprefix="uc2" %>
<%@ Register src="foot.ascx" tagname="foot" tagprefix="uc3" %>
<%@ Register src="category.ascx" tagname="category" tagprefix="uc4" %>
<%@ Register src="product_click.ascx" tagname="product_click" tagprefix="uc5" %>
<%@ Register src="product_by_category.ascx" tagname="product_by_category" tagprefix="uc6" %>
<%@ Register src="category_2.ascx" tagname="category_2" tagprefix="uc7" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>ESHOP 网商宝商城</title>
<link href="style/common.css" rel="stylesheet" type="text/css" />
<link href="style/index.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.2.6.pack.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript" src="js/indexhome.js"></script>
<script language="javascript" type="text/javascript" src="js/flash.js"></script>
<script type="text/javascript">
    $(document).ready(function() { 
        $($("ul.navigation a")[0]).addClass('hover');
    });
</script>
</head>
<body>
<form id="form1" runat="server">
<uc2:head ID="head1" runat="server" />
<div class="banner"><img src="images/ad/adfile001.jpg" alt="" /></div>
<!-- /end banner -->
<div class="defaultMain">
 <div class="defaultMainLeft">
  <h2 class="dirtitle">全部商品分类</h2>
  <uc4:category ID="category1" runat="server"></uc4:category>
  <!-- /end 商品分类 -->
  <uc5:product_click ID="product_click1" runat="server"></uc5:product_click>
  <!-- /end theleftList01 -->
  <div class="banner"><img src="images/ad/adfile005.jpg" alt="" /></div>
  <!-- /end banner -->
  <uc6:product_by_category ID="product_by_category1" runat="server" CategoryId="544"></uc6:product_by_category>
  <!-- /end theleftList02 -->
  <div class="banner"><img src="images/ad/adfile006.jpg" alt="" /></div>
  <!-- /end banner -->
  <div class="banner"><img src="images/ad/adfile007.jpg" alt="" /></div>
  <!-- /end banner -->
  <uc6:product_by_category ID="product_by_category2" runat="server" CategoryId="543"></uc6:product_by_category>
  <!-- /end theleftList03 -->
  <div class="banner"><img src="images/ad/adfile008.jpg" alt="" /></div>
  <!-- /end banner -->
  <div class="banner"><img src="images/ad/adfile009.jpg" alt="" /></div>
  <!-- /end banner -->
 </div>
 <!-- /end defaultMainLeft -->
 <div class="defaultMainRight">
  <div class="thelistone">
   <div class="slide">
   <script type="text/javascript">
function getId(id) {return document.getElementById(id);}
function addLoadEvent(func){
 var oldonload = window.onload;
 if (typeof window.onload != 'function') {
  window.onload = func;
 } else {
  window.onload = function(){
   oldonload();
   func();
  }
 }
}
function moveElement(elementID,final_x,final_y,interval) {
  if (!document.getElementById) return false;
  if (!document.getElementById(elementID)) return false;
  var elem = document.getElementById(elementID);
  if (elem.movement) {
    clearTimeout(elem.movement);
  }
  if (!elem.style.left) {
    elem.style.left = "0px";
  }
  if (!elem.style.top) {
    elem.style.top = "0px";
  }
  var xpos = parseInt(elem.style.left);
  var ypos = parseInt(elem.style.top);
  if (xpos == final_x  &&  ypos == final_y) {
  return true;
  }
  if (xpos < final_x) {
    var dist = Math.ceil((final_x - xpos)/10);
    xpos = xpos + dist;
  }
  if (xpos > final_x) {
    var dist = Math.ceil((xpos - final_x)/10);
    xpos = xpos - dist;
  }
  if (ypos < final_y) {
    var dist = Math.ceil((final_y - ypos)/10);
    ypos = ypos + dist;
  }
  if (ypos > final_y) {
    var dist = Math.ceil((ypos - final_y)/10);
    ypos = ypos - dist;
  }
  elem.style.left = xpos + "px";
  elem.style.top = ypos + "px";
  var repeat = "moveElement('"+elementID+"',"+final_x+","+final_y+","+interval+")";
  elem.movement = setTimeout(repeat,interval);
}
function classNormal(iFocusBtnID,iFocusTxID){
 var iFocusBtns= getId(iFocusBtnID).getElementsByTagName('li');
 var iFocusTxs = getId(iFocusTxID).getElementsByTagName('li');
 for(var i=0; i<iFocusBtns.length; i++) {
  iFocusBtns[i].className='normal';
  iFocusTxs[i].className='normal';
 }
}
function classCurrent(iFocusBtnID,iFocusTxID,n){
 var iFocusBtns= getId(iFocusBtnID).getElementsByTagName('li');
 var iFocusTxs = getId(iFocusTxID).getElementsByTagName('li');
 iFocusBtns[n].className='current';
 iFocusTxs[n].className='current';
}
function iFocusChange() {
 if(!getId('ifocus')) return false;
 getId('ifocus').onmouseover = function(){atuokey = true};
 getId('ifocus').onmouseout = function(){atuokey = false};
 var iFocusBtns = getId('ifocus_btn').getElementsByTagName('li');
 var listLength = iFocusBtns.length;
 iFocusBtns[0].onmouseover = function() {
  moveElement('ifocus_piclist',0,0,5);
  classNormal('ifocus_btn','ifocus_tx');
  classCurrent('ifocus_btn','ifocus_tx',0);
 }
 if (listLength>=2) {
  iFocusBtns[1].onmouseover = function() {
   moveElement('ifocus_piclist',0,-226,5);
   classNormal('ifocus_btn','ifocus_tx');
   classCurrent('ifocus_btn','ifocus_tx',1);
  }
 }
 if (listLength>=3) {
  iFocusBtns[2].onmouseover = function() {
   moveElement('ifocus_piclist',0,-452,5);
   classNormal('ifocus_btn','ifocus_tx');
   classCurrent('ifocus_btn','ifocus_tx',2);
  }
 }
 if (listLength>=4) {
  iFocusBtns[3].onmouseover = function() {
   moveElement('ifocus_piclist',0,-678,5);
   classNormal('ifocus_btn','ifocus_tx');
   classCurrent('ifocus_btn','ifocus_tx',3);
  }
 }
 if (listLength>=5) {
  iFocusBtns[4].onmouseover = function() {
   moveElement('ifocus_piclist',0,-904,5);
   classNormal('ifocus_btn','ifocus_tx');
   classCurrent('ifocus_btn','ifocus_tx',4);
  }
 }
}
setInterval('autoiFocus()',5000);
var atuokey = false;
function autoiFocus() {
 if(!getId('ifocus')) return false;
 if(atuokey) return false;
 var focusBtnList = getId('ifocus_btn').getElementsByTagName('li');
 var listLength = focusBtnList.length;
 for(var i=0; i<listLength; i++) {
  if (focusBtnList[i].className == 'current') var currentNum = i;
 }
 if (currentNum==0 && listLength!=1 ){
  moveElement('ifocus_piclist',0,-226,5);
  classNormal('ifocus_btn','ifocus_tx');
  classCurrent('ifocus_btn','ifocus_tx',1);
 }
 if (currentNum==1 && listLength!=2 ){
  moveElement('ifocus_piclist',0,-452,5);
  classNormal('ifocus_btn','ifocus_tx');
  classCurrent('ifocus_btn','ifocus_tx',2);
 }
 if (currentNum==2 && listLength!=3 ){
  moveElement('ifocus_piclist',0,-678,5);
  classNormal('ifocus_btn','ifocus_tx');
  classCurrent('ifocus_btn','ifocus_tx',3);
 }
if (currentNum==3 && listLength!=4){
  moveElement('ifocus_piclist',0,-904,5);
  classNormal('ifocus_btn','ifocus_tx');
  classCurrent('ifocus_btn','ifocus_tx',4);
 }
 if (currentNum==4 ){
  moveElement('ifocus_piclist',0,0,5);
  classNormal('ifocus_btn','ifocus_tx');
  classCurrent('ifocus_btn','ifocus_tx',0);
 }
 if (currentNum==1 && listLength==2 ){
  moveElement('ifocus_piclist',0,0,5);
  classNormal('ifocus_btn','ifocus_tx');
  classCurrent('ifocus_btn','ifocus_tx',0);
 }
 if (currentNum==2 && listLength==3 ){
  moveElement('ifocus_piclist',0,0,5);
  classNormal('ifocus_btn','ifocus_tx');
  classCurrent('ifocus_btn','ifocus_tx',0);
 }
}
addLoadEvent(iFocusChange);
  </script>
      <DIV id=ifocus>
        <DIV id=ifocus_pic>
          <DIV style="TOP: 0px; LEFT: 0px" id=ifocus_piclist>
            <UL>
              <LI><A href="#" target="_blank"><img alt=网商宝商城 src="images/tbanner1.jpg"></A></LI>
              <LI><A href="#" target="_blank"><img alt=网商宝商城 src="images/tbanner2.jpg"></A></LI>
              <LI><A href="#" target="_blank"><img alt=索菲亚衣柜 src="images/tbanner3.jpg"></A></LI>
              <LI><A href="#" target="_blank"><img alt=LO.SUNG src="images/tbanner4.jpg"></A></LI>
              <li><a href="#" target="_blank"><img alt=东鹏洁具 src="images/tbanner5.jpg" /></a></li>
            </UL>
          </DIV>
          <DIV id=ifocus_btn>
            <UL>
              <A href="#" target="_blank">
              <LI class=current>网商宝商城</LI>
              </A> <A href="#" target="_blank">
              <LI class=current>网商宝商城</LI>
              </A> <A href="#" target="_blank">
              <LI class=current>素菲亚衣柜</LI>
              </A> <A href="#" target="_blank">
              <LI class=current>LO.SUNG</LI>
              </A> <A href="#" target="_blank">
              <LI class=current>东鹏洁具</LI>
              </A>
            </UL>
          </DIV>
          <DIV id=ifocus_opdiv></DIV>
          <DIV style="DISPLAY: none" id=ifocus_tx>
            <UL>
              <A href="#" target="_blank">
              <LI  class=current>ESHOP 网商宝商城	</LI>
              </A> <A href="#" target="_blank">
              <LI  class=current>ESHOP 网商宝商城</LI>
              </A> <A href="#" target="_blank">
              <LI  class=current>素菲亚衣柜</LI>
              </A> <A href="#" target="_blank">
              <LI  class=current>LO.SUNG</LI>
              </A> <A href="#" target="_blank">
              <LI  class=current>东鹏洁具</LI>
              </A>
            </UL>
          </DIV>
        </DIV>
      </DIV>
   </div>
   <!-- /end slide -->
   <dl class="Notice">
    <dt>商城公告</dt>
    <dd>
     <ul>
     <asp:Repeater ID="rSitepost" runat="server">
     <ItemTemplate>
     <li><span>[<%#DateTime.Parse(Eval("create_date").ToString()).ToString("M-d")%>]</span><a href='news.aspx?Id=<%#Eval("Id") %>' target="_blank"><%#com.eshop.www.Tools.StringHelper.CutString(Eval("title").ToString(),25) %></a></li>
     </ItemTemplate>
     </asp:Repeater>  
     <li class="more"><a href="news_list.aspx?categoryId=4" target="_blank">更多..</a></li>
     </ul>
    </dd>
   </dl>
   <!-- /end -->
  </div>
  <!-- /end thelistone -->
  <dl class="thelistwo">
   <dt><img src="images/icon-015.gif" alt="" /><uc7:category_2 ID="category_21" 
           runat="server"  IsNew="true" /></dt>
   <dd>
    <ul>
    <asp:Repeater ID="rNewsProduct" runat="server">
    <ItemTemplate>
        <li><a href='p_show.aspx?productId=<%#Eval("Id") %>' target="_blank"><img src='/upload-file/images/product/<%#GetImage(int.Parse(Eval("Id").ToString())).Image %>' alt='<%#GetImage(int.Parse(Eval("Id").ToString())).Alt %>' width="166px" height="166px" /></a><p><a href="p_show.aspx" target="_blank"><%#Eval("product_name") %></a></p><%#float.Parse(Eval("sale_price").ToString()).ToString("0") %>元<span>￥<%#float.Parse(Eval("price").ToString()).ToString("0") %>元</span></li>
    </ItemTemplate>
    </asp:Repeater>
    </ul>
   </dd>
  </dl>
  <!-- /end thelistwo -->
  <div class="banner"><img src="images/ad/adfile003.jpg" alt="" /></div>
  <!-- /end banner -->
  <dl class="thelisthree">
   <dt><img src="images/icon-016.gif" alt="" /><uc7:category_2 ID="category_22" 
           runat="server" IsHot="true" /></dt>
   <dd>
    <ul>
    <asp:Repeater ID="rHotProduct" runat="server">
    <ItemTemplate>
        <li><a href='p_show.aspx?productId=<%#Eval("Id") %>'  target="_blank"><img src='/upload-file/images/product/<%#GetImage(int.Parse(Eval("Id").ToString())).Image %>' alt='<%#GetImage(int.Parse(Eval("Id").ToString())).Alt %>' width="166px" height="166px" /></a><p><a href="p_show.aspx"  target="_blank"><%#Eval("product_name") %></a></p><%#float.Parse(Eval("sale_price").ToString()).ToString("0") %>元<span>￥<%#float.Parse(Eval("price").ToString()).ToString("0") %>元</span></li>
    </ItemTemplate>
    </asp:Repeater>
    </ul>
   </dd>
  </dl>
  <!-- /end thelisthree -->
  <dl class="thelistfour">
   <dt><img src="images/icon-017.gif" alt="" /><uc7:category_2 ID="category_23" 
           runat="server" IsDiscount="true"/>
      </dt>
   <dd>
    <ul>
    <asp:Repeater ID="rDiscountProduct" runat="server">
    <ItemTemplate>
        <li><a href='p_show.aspx?productId=<%#Eval("Id") %>' target="_blank"><img src='/upload-file/images/product/<%#GetImage(int.Parse(Eval("Id").ToString())).Image %>' alt='<%#GetImage(int.Parse(Eval("Id").ToString())).Alt %>' width="166px" height="166px"/></a><p><a href="p_show.aspx"  target="_blank"><%#Eval("product_name") %></a></p><%#float.Parse(Eval("sale_price").ToString()).ToString("0") %>元<span>￥<%#float.Parse(Eval("price").ToString()).ToString("0") %>元</span></li>
    </ItemTemplate>
    </asp:Repeater>
    </ul>
   </dd>
  </dl>
  <!-- /end thelistfour -->
 </div>
 <!-- /end defaultMainRight -->
</div>
<!-- /end defaultMain -->
<div class="banner"><a href="p_list.aspx?categoryId=783"><img src="images/ad/adfile004.jpg" alt="" /></a></div>
<!-- /end banner -->
<uc1:help ID="help1" runat="server" />    
<!-- /end help -->
<uc3:foot ID="foot1" runat="server" />
    </form>
</body>
</html>
